package com.server.modules.api.web;


import com.server.modules.api.Base.BaseAppController;
import com.server.modules.api.vo.BaseQueryVo;
import com.server.modules.api.vo.list.LoanTypeList;
import com.server.modules.sys.entity.tag.Tag;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 贷款类型接口
 * Created by Administrator on 2016/7/22.
 */
@Controller
@RequestMapping(value = "/api/loan")
public class TagsListAPIController extends BaseAppController {

	@ResponseBody
	@RequestMapping(value = "/getAllTagsList", method = RequestMethod.POST)
	public BaseQueryVo<LoanTypeList> getAllTagsList(BaseQueryVo vo) {
		setPageConfig(vo);
		//获取贷款标签列表
		List<Tag> list = tagAPIService.findList(new Tag());
		//如果获取失败
		if (list == null | list.size() == 0) {
			vo.setRetMsg("无标签信息");
			vo.setRetCode(120);
		} else {
			vo.setRetCode(0);
			vo.setRetMsg("标签获取成功");
			vo.setData(list);
		}
		return vo;
	}
}
